<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>章节管理</title>
    <link rel="icon" href="../../img/logoimg.png" type="image/ico">
</head>
<style>
    p a{
        color: black;
        text-decoration: none;
        font-weight: bold;
    }
    td a{
        text-decoration: none;
        text-align: center;
    }
</style>
<div th:include="common/style"></div>
<body style="background: #f7f1e3;">
<p style="color: grey;">
    作品管理 > <span th:text="${bookname}"></span>
</p>
<p>
    <a th:href="@{toAddChapter(bookname=${bookname},chaptername=${chaptername},bookid=${bookid})}">&nbsp;&nbsp;新增章节</a>
</p>
<table border="2" style="width: 80%;">
    <tr style="color: grey; text-align: center;">
        <td>章节名称</td>
        <td>字数</td>
        <td>发布时间</td>
        <td>审核状态</td>
        <td>操作</td>
    </tr>
    <tr th:each="c1:${bookChapter}">
        <td th:text="${c1.bChaptername}"></td>
        <td th:text="${c1.bNum}"></td>
        <td th:text="${c1.bDate}"></td>
        <td th:if="${c1.bcheckstatus == 1}" th:text="审核中"></td>
        <td th:if="${c1.bcheckstatus == 2}" th:text="已发布" style="color: green;"></td>
        <td th:if="${c1.bcheckstatus == 3}" th:text="审核不通过" style="color: red;"></td>
        <td style="text-align: center;">
            <a th:href="@{toUpdate(bChapterid=${c1.bChapterid},bookname=${bookname},chaptername=${chaptername})}">修改</a>&nbsp;&nbsp;
            <a th:href="@{delChapter(bChapterid=${c1.bChapterid})}">删除</a>&nbsp;&nbsp;
            <a th:href="@{preview(bChapterid=${c1.bChapterid})}">预览</a>
        </td>
    </tr>
</table>
</body>
</html>